<%-- <%@	page language="java" session="false"
	contentType="text/html;charset=utf-8"
	%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.List"%> 
<%
	String path = request.getContextPath();
	
	User sessionUser = (User) request.getSession().getAttribute("user");
	if(sessionUser == null){
		response.sendRedirect(path + "/jsp/check_user.jsp");
		return;
	}
	String indexUrl = path + "/jsp/login.jsp";
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
	//派单人列表
	UserService userService = (UserService) ServiceUtil.getService("userService");
	List<User> userList = userService.queryUserList();
	GenerateEleRegistrationService generateEleRegistrationService = (GenerateEleRegistrationService) ServiceUtil.getService("generateEleRegistrationService");
	//分公司列表
	//List<GenerateEleRegistration> companyList = generateEleRegistrationService.queryCompanyList();
	//开始/结束确认列表
	List<GenerateEleRegistration> startAffirmList = generateEleRegistrationService.queryAffirmList(0);
	List<GenerateEleRegistration> endAffirmList = generateEleRegistrationService.queryAffirmList(1);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		
	    <link href="<%=path%>/css/basic.css" rel="stylesheet" type="text/css" />
	    <link href="<%=path%>/css/admin.css" rel="stylesheet" type="text/css" />
		
	    <link href="<%=path%>/js/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/js/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
		
	    <script type="text/javascript" src="<%=path %>/js/jquery.min.js"></script>
		<script type="text/javascript" src="<%=path %>/js/easyui/jquery.easyui.min.js"></script>
	    <script type="text/javascript" src="<%=path %>/js/easyui/locale/easyui-lang-zh_CN.js"></script>
	    <script type="text/javascript" src="<%=path %>/js/clipboard.min.js"></script>
		<script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>		
		<script language="javascript" type="text/javascript" src="<%=path %>/js/ele.js?<%=System.currentTimeMillis() %>"></script>		
		<script type="text/javascript">
		$(function(){
			Ele66.initSData();
			Ele66.clearSData();
			Ele66.queryList();
			$("#user_id").combobox("setValue",$("#session_user_id").val());
			//复制功能
			var clipboard = new Clipboard('#copyData',{
				text : function(){
					return $("#copyData").val();
				}
			});
		    clipboard.on('success', function(e) {
		        $.messager.alert("操作提示", "复制成功！","info");
		    });
		    clipboard.on('error', function(e) {
		        $.messager.alert("操作提示", "复制失败！","error");
		    })
		});
		</script>
	</head>

	<body>
		<input type="hidden" id="session_user_id" value="<%=sessionUser != null ? sessionUser.getId() : "" %>" />
		<input type="hidden" id="user_role" value="<%=sessionUser.getRole() %>" />
		<div id="mainDiv" class="main">
			<table id="tt" style="height:290px" title="发电登记列表" toolbar="#searchtool" loadMsg="正在查询..." iconCls="icon-edit" url="">
			</table>
			<!-- <div id="pp" style="background:#efefef;border:1px solid #ccc;"></div> -->
		</div>
		<div id="searchtool" style="padding:5px;clear: both">
			<form id="sdata">
				<div style="padding:5px;clear: both">
					<div>
						<span>日期：</span>
						从&nbsp;<input class="Wdate" type="text" id="s_create_time" name="s_create_time" value="" style="height:16px;width: 120px" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"/>
						&nbsp;至&nbsp;
						<input class="Wdate" type="text" id="e_create_time" name="e_create_time" value="" style="height:16px;width: 120px" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"/> 
						<span style="margin-left: 20px">工单号：</span><input type="text" id="s_order_code" name="order_code" style="height:16px;width: 120px" value="" /> 
						<span >电话：</span><input type="text" id="s_contact_number" name="contact_number" style="height:16px;width: 120px" value="" /> 
					</div>
					<div style="margin-top: 5px">
						<span>分公司：</span><select id="s_company_id" name="company_id" class="easyui-combobox" style="height:20px;width:100px"></select>
						<span>区域：</span><select id="s_area_id" name="area_id" class="easyui-combobox" style="height:20px;width:140px"></select>
						<span style="margin-left: 3px">局站名称：</span><input type="text" id="s_station_name" name="station_name" style="height:16px;width: 120px" value="" />
					  	<a href="javascript:Ele66.findData()" class="easyui-linkbutton" style="width: 70px;margin-left: 10px" data-options="iconCls:'icon-search'">查询</a>
					  	<a href="javascript:Ele66.clearSData()" class="easyui-linkbutton" style="width: 70px;margin-left: 10px" data-options="iconCls:'icon-undo'">重置</a>
				  	</div>
			  	</div>
			</form>
			<div>
			  	<a href="javascript:Ele66.toAdd()" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a>&nbsp;&nbsp;&nbsp;
			  	<input type="hidden" id="copyData" value="" />
			  	<a href="javascript:Ele66.copyData(1)" class="easyui-linkbutton" data-options="iconCls:'icon-save'" >派单复制</a>&nbsp;&nbsp;&nbsp;
			  	<a href="javascript:Ele66.copyData(2)" class="easyui-linkbutton" data-options="iconCls:'icon-save'" >闭单复制</a>&nbsp;&nbsp;&nbsp;
			  	<a href="javascript:Ele66.toModify()" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>&nbsp;&nbsp;&nbsp;
			  	<%if(sessionUser.getRole() == 1){ %>
			  	<a href="javascript:Ele66.deleteData()" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>&nbsp;&nbsp;&nbsp;
			  	<%} %>
			  	<a href="javascript:Ele66.exportData()" class="easyui-linkbutton" data-options="iconCls:'icon-print'">导出</a>&nbsp;&nbsp;&nbsp;
			  	<a href="javascript:Ele66.toAddStation()" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加局站</a>&nbsp;&nbsp;&nbsp;
			  	<a href="javascript:Ele66.reloadData()" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">刷新</a>
		  	</div> 
		</div> 
		<div id="dlg" class="easyui-dialog" style="width: 830px; height: auto; padding: 10px 20px"  
	         data-options="closed:true,buttons:'#dlg-buttons',title:'发电登记'">
	         <form id="eleData">
	         <input type="hidden" id="id" name="id" value="" />
	         <table width="95%" border="0" cellspacing="0" cellpadding="0" style="border:0px solid #cbd5d8;margin-top: 10px;" align="center">
		    	<tr>
		    		<td>
						<div style="margin-left: 10px;margin-top: 5px;">
						日期：
						</div>
					</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
			    			<input class="Wdate" type="text" id="create_time" name="create_t" value="" style="height:16px;width:200px" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"/>
		    			</div>
		    		</td>
		    		<td width="13%">
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			派单人：
		    			</div>
		    		</td>
		    		<td width="37%">
		    			<div style="margin-bottom: 10px;">
		    				<!-- <input type="hidden" id="user_id" name="user_id" value="" />
		    				<input type="text" id="user_name" name="user_name" value="" style="width: 220px"/> -->
		    				<select id="user_id" name="user_id" class="easyui-combobox" editable="false" style="height:20px;width:205px" required="true">
				    			<%for(User u : userList){ %>
				    			<option value="<%=u.getId() %>"><%=u.getUser_name() %></option>
				    			<%} %>
			    			</select>
		    			</div>
		    		</td>
		    	</tr>
		    	<tr>
		    		<td>
						<div style="margin-left: 10px;margin-bottom: 10px;">
						分公司：
						</div>
					</td>
					<td>
						<div style="margin-bottom: 10px;">
							<!-- <input type="hidden" id="company_id" name="company_id" value="" />
		    				<input type="text" id="company_name" name="company_name" value="" style="width: 220px"/> -->
		    				<select id="company_id" name="company_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
						</div>
					</td>
					<td>
						<div style="margin-left: 10px;margin-bottom: 10px;">
						所属区域：
						</div>
					</td>
					<td>
						<div style="margin-bottom: 10px;">
							<!-- <input type="hidden" id="area_id" name="area_id" value="" />
		    				<input type="text" id="area_name" name="area_name" value="" style="width: 220px"/> -->
		    				<select id="area_id" name="area_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
						</div>
					</td>
		    	</tr>	
		    	<tr>
		    		<td width="13%">
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			网管：
		    			</div>
		    		</td>
		    		<td width="37%">
		    			<div style="margin-bottom: 10px;" >
							<!-- <input type="hidden" id="network_id" name="network_id" value="" />
		    				<input type="text" id="network_name" name="network_name" value="" style="width: 200px"/> -->
		    				<select id="network_id" name="network_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>			    		
		    			</div>
		    		</td>
		    		<td width="13%">
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			节点信息：
		    			</div>
		    		</td>
		    		<td width="37%">
		    			<div style="margin-bottom: 10px;">
				    		<select id="node_id" name="node_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
		    			</div>
		    		</td>				    		
		    	</tr>
		    	<tr>
		    		<td width="13%">
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			机房产权：
		    			</div>
		    		</td>
		    		<td width="37%">
		    			<div style="margin-bottom: 10px;">
			    			<!-- <input type="hidden" id="room_attribute_id" name="room_attribute_id" value="" />
		    				<input type="text" id="room_attribute" name="room_attribute" value="" style="width: 200px"/> -->
		    				<select id="room_attribute_id" name="room_attribute_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			局站类型：	
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
				    		<select id="station_type_id" name="station_type_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
		    			</div>
		    		</td>				    		
		    	</tr>							    						    			    	
		    	<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			局站名称：	
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<select id="station_id" name="station_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			派单电压：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
			    			<input type="text" id="derect_voltage" name="derect_voltage" value="" style="width: 200px"/>
			    			<span style="color: red">*</span>
		    			</div>
		    		</td>
		    	</tr>
		    	<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			停电时间：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
			    			<input class="Wdate" type="text" id="poweroff_time" name="poweroff_t" value="" style="height:16px;width: 200px" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"/>
			    			<span style="color: red">*</span>
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			油机号：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<!-- <input type="hidden" id="engine_id" name="engine_id" value="" />
		    				<input type="text" id="engine_code" name="engine_code" value="" style="width: 200px"/> -->
		    				<select id="engine_id" name="engine_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    		</div>
		    		</td>
		    	</tr>
		    	<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			开始发电时间：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
			    			<input class="Wdate" type="text" id="start_time" name="start_t" value="" style="height:16px;width: 200px" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"/>
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			开始确认：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
			    			<select id="start_affirm" name="start_affirm" class="easyui-combobox" editable="false" style="height:20px;width:205px" required="true">
			    				<%for(int i = 0; i < startAffirmList.size(); i++){
			    					GenerateEleRegistration startAffirm = startAffirmList.get(i);
			    				 %>
			    				<option value="<%=startAffirm.getAffirm() %>"><%=startAffirm.getAffirm() %></option>
			    				<%} %>
			    			</select>
			    		</div>
		    		</td>
		    		
		    	</tr>
		    	<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			结束发电时间：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
			    			<input class="Wdate" type="text" id="end_time" name="end_t" value="" style="height:16px;width: 200px" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"/>
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			结束确认：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
			    			<select id="end_affirm" name="end_affirm" class="easyui-combobox" editable="false" style="height:20px;width:205px" required="true">
			    				<%for(int i = 0; i < endAffirmList.size(); i++){
			    					GenerateEleRegistration endAffirm = endAffirmList.get(i);
			    				 %>
			    				<option value="<%=endAffirm.getAffirm() %>"><%=endAffirm.getAffirm() %></option>
			    				<%} %>
			    			</select>
			    		</div>
		    		</td>				    		
		    	</tr>
		    	<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			开始照片：
		    			</div>
		    		</td>
		    		<td>
		    			<!-- <div style="margin-bottom: 10px;">
			    			<input type="radio" name="start_photo" id="start_photo0" value="" checked="checked"/>默认
			    			<input type="radio" name="start_photo" id="start_photo1" value="有" />有
		    				<input type="radio" name="start_photo" id="start_photo2" value="无"/>无
			    		</div> -->
			    		<div style="margin-bottom: 10px;">
		    				<input type="text" id="start_photo" name="start_photo" value="" style="width: 200px"/>
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			结束照片：
		    			</div>
		    		</td>
		    		<td>
		    			<!-- <div style="margin-bottom: 10px;">
		    				<input type="radio" name="end_photo" id="end_photo0" value="" checked="checked"/>默认
			    			<input type="radio" name="end_photo" id="end_photo1" value="有" />有
		    				<input type="radio" name="end_photo" id="end_photo2" value="无"/>无
			    		</div>  -->
			    		<div style="margin-bottom: 10px;">
		    				<input type="text" id="end_photo" name="end_photo" value="" style="width: 200px"/>
			    		</div>
		    		</td>				    		
		    	</tr>
		    	<!-- 
				<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			发电时长：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="text" id="generation_minutes" name="generation_minutes" value=""  style="height:16px;width:90px" />（分钟）
		    				<a class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="Ele66.calEleMin()">计算</a> 
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			发电油耗：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="text" id="generation_fee" name="generation_fee" value=""  style="height:16px;width:90px" />（升）
		    				<a class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="Ele66.calEleOil()">计算</a> 
			    		</div>
		    		</td>				    		
		    	</tr>
		    	 -->
				<tr>
					<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			电话：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="text" id="contact_number" name="contact_number" value="" style="width: 200px"/>
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			工单号：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="text" id="order_code" name="order_code" value=""  style="height:16px;width:200px" />
			    		</div>
		    		</td>
		    	</tr>
				<tr>
					<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			备注1：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="text" id="ext1" name="ext1" value="" style="width: 200px"/>
			    		</div>
		    		</td>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			备注2：
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="text" id="ext2" name="ext2" value="" style="width: 200px"/>
			    		</div>
		    		</td>
		    	</tr>
		    </table>
		    </form>
	    </div>  
	    <div id="dlg-buttons" style="text-align: center;">  
	        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="Ele66.addEle()">保存</a>  
	        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="Ele66.closeDig()">关闭</a>  
	    </div>
	    <!-- 添加局站 -->
		<div id="station_dlg" class="easyui-dialog" style="width: 530px; height: 260px; padding: 10px 20px"  
	         data-options="closed:true,buttons:'#st-dlg-buttons',title:'添加局站'">
	         <form id="stationData">
	         <table width="95%" border="0" cellspacing="0" cellpadding="0" style="border:0px solid #cbd5d8;margin-top: 10px;" align="center">
		    	<tr>
		    		<td>
						<div style="margin-left: 10px;margin-bottom: 10px;">
						分公司：
						</div>
					</td>
					<td>
						<div style="margin-bottom: 10px;">
		    				<select id="st_company_id" name="company_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
						</div>
					</td>
		    	</tr>
		    	<tr>
		    		<td>
						<div style="margin-left: 10px;margin-bottom: 10px;">
						所属区域：
						</div>
					</td>
					<td>
						<div style="margin-bottom: 10px;">
							<input type="hidden" id="st_area_name" name="area_name" value="" />
		    				<select id="st_area_id" name="area_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
						</div>
					</td>
		    	</tr>
		    	<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			局站类型：	
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="hidden" id="st_station_type" name="station_type" value="" />
				    		<select id="st_station_type_id" name="station_type_id" class="easyui-combobox" style="height:20px;width:205px" required="true">
			    			</select>
			    			<span style="color: red">*</span>
		    			</div>
		    		</td>
		    	</tr>
		    	<tr>
		    		<td>
		    			<div style="margin-left: 10px;margin-bottom: 10px;">
		    			局站名称：	
		    			</div>
		    		</td>
		    		<td>
		    			<div style="margin-bottom: 10px;">
		    				<input type="text" id="st_station_name" name="station_name" value="" style="width: 200px"/>
			    			<span style="color: red">*</span>
		    			</div>
		    		</td>
		    	</tr>
		    </table>
		    </form>
	    </div>  
	    <div id="st-dlg-buttons" style="text-align: center;">  
	        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="Ele66.addStation()">保存</a>  
	        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="Ele66.closeStDig()">关闭</a>  
	    </div>
	</body>
</html>
 --%>